import axios from '@/api/fetch';
//import * as types from './types';
import SERVER from '@/api/server';
//索赔结算汇总提报
export const getListByPage = params => axios.post(`${SERVER.CLAIMFAC}/rPSettleSum/getListByPage`, params);
//新增弹窗-数据保存
export const newSave = params => axios.post(`${SERVER.CLAIMFAC}/rPSettleSum/saveOne`, params);
//主页面的单条删除
export const deleteOne = (id, params) => axios.post(`${SERVER.CLAIMFAC}/rPSettleSum/updateStatusById/${id}`,{params} );
//修改回显
export const quyrPSettleSum = (id, params) => axios.get(`${SERVER.CLAIMFAC}/rPSettleSum/selectById/${id}`, { params });
//编辑的保存
export const editSave = params => axios.post(`${SERVER.CLAIMFAC}/rPSettleSum/updateByPtId`,  params );


//配件类型查询
export const selectListByPage = params => axios.get(`${SERVER.CLAIMFAC}/rPSettleSum/getListByPage`,params);
//导出模版
export const downloadModel = params => {
  const url = `${SERVER.CLAIMFAC}/rPSettleSum/exportModel`;
  return axios({
    url,
    method: 'post',
    responseType: 'blob'
  });
};
//导出
export const getListForExport = (params) => axios.post(`${SERVER.CLAIMFAC}/rPSettleSum/getListForExport`, params, {
    responseType: 'blob'
  });
  //下载中心导出
  export const exporturl = params => axios.post(`/api/cmscloud.excel/downloadExcel/exportExcel/${params.CODE}`, params);

//字典
export const getPartType = (params) => axios.get(`${SERVER.CLAIMFAC}/const/getBaseDataByType`, {params});
//获取配件
export const getPartList = params =>
  axios.get(`${SERVER.CLAIMFAC}/const/getPartList`, {
    params
  });
//获取结算批次
export const qurListByPage = params => axios.post(`${SERVER.CLAIMFAC}/rpBatch/getListByPage`, params);

//提交
export const submitById = (id, params) => axios.post(`${SERVER.CLAIMFAC}/rPSettleSum/submitById/${id}`,{params} );

//批量启动
export const piliangtijiao = data => axios.post(`${SERVER.CLAIMFAC}/rPSettleSum/updateStatusByIds`,  null ,{params : data} );
